;
(function (window, angular) {
    'use strict';
    angular.module("Controller.Stock", ["Controller.Stock.SellOut", "Controller.Stock.UnusualOut", "Controller.Stock.PickingOut",
        "Controller.Stock.PurchaseIn", "Controller.Stock.UnusualIn", "Controller.Stock.BeginningIn", "Controller.Stock.DeliveryOrderIn", "Controller.Stock.ReturnIn", "Controller.Stock.BackIn",
        "Controller.Stock.BackOut",
        "Controller.Stock.Inventory", "Controller.Stock.StockAllocation","Controller.Stock.ForwardAllotApply", "Controller.Stock.StockAllocationPlan", "Controller.Stock.PickingBill", "Controller.Stock.StorageRecords", "Controller.Stock.DepotStock", "Controller.Stock.ClientStock",
        "Controller.Stock.MaterialTransfer", "Controller.Stock.SafeInventory", "Controller.Stock.SafeAndLack",  "Controller.Stock.Split", "Controller.Stock.Restore", "Controller.Stock.SplitRecord", "Controller.Stock.SplitArrival",
        "Controller.Stock.UnsoldStock", "Controller.Stock.UnsoldStockConfig", "Controller.Stock.ReceiptIn","Controller.Stock.StorageRecordsSum","Controller.Stock.StorageFlow",
        "Controller.Stock.SluggishShard", "Controller.Stock.PriceInventQReport","Controller.Stock.MiddleDetail","Controller.Stock.SapStock",
        "Controller.Stock.UnsalableInventory","Controller.Stock.ComplimentaryOut","Controller.Stock.KqSafetyInventory","Controller.Stock.SubContract"
    ])
        .config(['$stateProvider', function ($stateProvider) {

            $stateProvider.state("app.stock.sellOut", {
                url: "/sellOut",
                templateUrl: "view/stock/sellOut.html",
                controller: "SellOutCtrl"
            });

            $stateProvider.state("app.stock.unusualOut", {
                is18n: true,
                url: "/unusualOut",
                templateUrl: "view/stock/unusualOut.html",
                controller: "UnusualOutCtrl"
            });

            $stateProvider.state("app.stock.pickingOut", {
                url: "/pickingOut",
                templateUrl: "view/stock/pickingOut.html",
                controller: "PickingOutCtrl"
            });

            $stateProvider.state("app.stock.purchaseIn", {
                url: "/purchaseIn",
                templateUrl: "view/stock/purchaseIn.html",
                controller: "PurchaseInCtrl",
                is18n:true,
            });

            $stateProvider.state("app.stock.unusualIn", {
                is18n: true,
                url: "/unusualIn",
                templateUrl: "view/stock/unusualIn.html",
                controller: "UnusualInCtrl",
                params: {
                    materialsNo: undefined,
                    crmOrder: undefined,
                    deliveryQty: undefined,
                }
            });

            $stateProvider.state("app.stock.beginningIn", {
                is18n: true,
                url: "/beginningIn",
                templateUrl: "view/stock/beginningIn.html",
                controller: "BeginningInCtrl"
            });

            $stateProvider.state("app.stock.returnIn", {
                is18n: true,
                url: "/returnIn",
                templateUrl: "view/stock/returnIn.html",
                controller: "ReturnInCtrl"
            });

            $stateProvider.state("app.stock.backIn", {
                url: "/backIn",
                templateUrl: "view/stock/backIn.html",
                controller: "BackInCtrl"
            });

            $stateProvider.state("app.stock.backOut", {
                url: "/backOut",
                templateUrl: "view/stock/backOut.html",
                controller: "BackOutCtrl"
            });

            $stateProvider.state("app.stock.deliveryOrderIn", {
                url: "/deliveryOrderIn",
                templateUrl: "view/stock/deliveryOrderIn.html",
                controller: "DeliveryOrderInCtrl"
            });

            $stateProvider.state("app.stock.inventory", {
                is18n: true,
                url: "/inventory",
                templateUrl: "view/stock/inventory.html",
                controller: "InventoryCtrl"
            });

            $stateProvider.state("app.stock.allocation", {
                is18n: true,
                url: "/stockAllocation",
                templateUrl: "view/stock/stockAllocation.html",
                controller: "StockAllocationCtrl",
                params: { canKaoObj: undefined }
            });

            $stateProvider.state("app.stock.forwardAllotApply", {
                is18n: true,
                url: "/forwardAllotApply",
                templateUrl: "view/stock/forwardAllotApply.html",
                controller: "ForwardAllotApplyCtrl",
            });

            $stateProvider.state("app.stock.allocationPlan", {
                url: "/allocationPlan",
                templateUrl: "view/stock/allocationPlan.html",
                controller: "StockAllocationPlanCtrl",
                params: { isCanKao: false }
            });

            $stateProvider.state("app.stock.pickingBill", {
                url: "/pickingBill",
                templateUrl: "view/stock/pickingBill.html",
                controller: "PickingBillCtrl"
            });

            $stateProvider.state("app.stock.storageRecords", {
                is18n: true,
                url: "/storageRecords",
                templateUrl: "view/stock/storageRecords.html",
                controller: "StorageRecordsCtrl"
            });
            $stateProvider.state("app.stock.storageRecordsSum", {
                url: "/storageRecordsSum",
                templateUrl: "view/stock/storageRecordsSum.html",
                controller: "StorageRecordsSumCtrl"
            });

            $stateProvider.state("app.stock.storageFlow", {
                url: "/storageFlow",
                templateUrl: "view/stock/storageFlow.html",
                controller: "StorageFlowCtrl"
            });

            $stateProvider.state("app.stock.depotStock", {
                is18n: true,
                url: "/depotStock",
                templateUrl: "view/stock/depotStock.html",
                controller: "DepotStockCtrl"
            });
            $stateProvider.state("app.stock.sapStock", {
                is18n: true,
                url: "/sapStock",
                templateUrl: "view/stock/sapStock.html",
                controller: "SapStockCtrl"
            });

            $stateProvider.state("app.stock.priceInventQReport", {
                is18n: true,
                url: "/priceInventQReport",
                templateUrl: "view/stock/priceInventQReport.html",
                controller: "PriceInventQReportCtrl"
            });

            $stateProvider.state("app.stock.middleDetail", {
                is18n: true,
                url: "/middleDetail",
                templateUrl: "view/stock/middleDetail.html",
                controller: "MiddleDetailCtrl"
            });

            $stateProvider.state("app.stock.clientStock", {
                url: "/clientStock",
                templateUrl: "view/stock/clientStock.html",
                controller: "ClientStockCtrl"
            });

            $stateProvider.state("app.stock.materialTransfer", {
                is18n: true,
                url: "/materialTransfer",
                templateUrl: "view/stock/materialTransfer.html",
                controller: "MaterialTransferCtrl"
            });

            $stateProvider.state("app.stock.safeInventory", {
                is18n: true,
                url: "/safeInventory",
                templateUrl: "view/stock/safeInventory.html",
                controller: "SafeInventoryCtrl"
            });

            $stateProvider.state("app.stock.safeAndLack", {
                is18n: true,
                url: "/safeAndLack",
                templateUrl: "view/stock/safeAndLack.html",
                controller: "SafeAndLackCtrl"
            });

            //拆件单
            $stateProvider.state("app.stock.split", {
                url: "/split",
                templateUrl: "view/stock/split.html",
                controller: "SplitCtrl"
            });
            $stateProvider.state("app.stock.restore", {
                url: "/restore",
                templateUrl: "view/stock/restore.html",
                controller: "RestoreCtrl"
            });
            $stateProvider.state("app.stock.splitRecord", {
                url: "/splitRecord",
                templateUrl: "view/stock/splitRecord.html",
                controller: "SplitRecordCtrl"
            });
            $stateProvider.state("app.stock.splitArrival", {
                url: "/splitArrival",
                templateUrl: "view/stock/splitArrival.html",
                controller: "SplitArrivalCtrl"
            });
            $stateProvider.state("app.stock.unsoldConfig", {
                url: "/unsoldConfig",
                templateUrl: "view/stock/unsoldStockConfig.html",
                controller: "UnsoldStockConfigCtrl"
            });
            $stateProvider.state("app.stock.unsoldQuery", {
                url: "/unsoldQuery",
                templateUrl: "view/stock/unsoldStock.html",
                controller: "UnsoldStockCtrl"
            });

            $stateProvider.state("app.stock.receiptIn", {
                is18n: true,
                url: "/receiptIn",
                templateUrl: "view/stock/receiptIn.html",
                controller: "ReceiptInCtrl"
            });

            $stateProvider.state("app.stock.sluggishShard", {
                url: "/sluggishShard",
                templateUrl: "view/stock/sluggishShard.html",
                controller: "SluggishShardCtrl"
            });

            $stateProvider.state("app.stock.guaranteesOut", {
                url: "/guaranteesOut",
                templateUrl: "view/stock/guaranteesOut.html",
                controller: "GuaranteesOutCtrl",
                params: {id: ""}
            });

            $stateProvider.state("app.stock.unsalableInventory", {
                url: "/unsalableInventory",
                templateUrl: "view/stock/unsalableInventory.html",
                controller: "UnsalableInventoryCtrl"
            });

            $stateProvider.state("app.sales.complimentaryOut", {
                url: "/complimentaryOut",
                templateUrl: "view/stock/complimentaryOut.html",
                controller: "ComplimentaryOutCtrl",
                params: {id: ""}
            });

            $stateProvider.state("app.stock.kqSafetyInventory", {
                url: "/kqSafetyInventory",
                templateUrl: "view/stock/kqSafetyInventory.html",
                controller: "KqSafetyInventoryCtrl"
            });

            $stateProvider.state("app.stock.subContract", {
                url: "/subContract",
                templateUrl: "view/stock/subContract.html",
                controller: "SubContractCtrl"
            });
        }])
        ;
})(window, window.angular);
